import React, { Component } from 'react'
import {Link} from 'react-router-dom'

export default class News extends Component {
  render() {
    // onst {history:{go,push,replace}} = this.props
    const {history:{ go }} = this.props
    return (
      <div>
        <h4>News</h4>
        <button onClick={() => {go(-1)}}>返回</button><hr/>
        <Link to="/detail">查看新闻详情</Link>
        <ul>
          {list.map((item,index) => <li key={index + 1}>{item}</li>)}
        </ul>
      </div>
    )
  }
}

const list = [...new Array(300)].map((item,index) => `${index}、这里是新闻数据......`)